package com.fengye.middleware.rabbitmq.boot.controller;

import com.fengye.middleware.rabbitmq.boot.messageType.topic.TopicPublisher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sky
 * @date 2021/06/10 21:55
 */

@RestController
@RequestMapping("/exchange")
@Slf4j
public class TopicExchangeController {

    @Autowired
    private TopicPublisher topicPublisher;

    @GetMapping("/topic")
    public void getOne(){
        topicPublisher.sendObjectMsg("通配符java", "local.middleware.mq.topic.routing.java.key");
        topicPublisher.sendObjectMsg("通配符php", "local.middleware.mq.topic.routing.php.key");
        topicPublisher.sendObjectMsg("通配符node.express", "local.middleware.mq.topic.routing.node.express.key");
        topicPublisher.sendObjectMsg("通配符node.koa.vue", "local.middleware.mq.topic.routing.node.koa.vue.key");
        topicPublisher.sendObjectMsg("通配符", "local.middleware.mq.topic.routing.key");
    }
}
